package com.xbell.app.sys.controller;

import java.util.Date;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.nacos.common.utils.DateFormatUtils;
import com.xbell.app.sys.common.ResponseMessage;
import com.xbell.app.sys.entity.SysRole;
import com.xbell.app.sys.entity.XbUser;

import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;

@RestController
@RequestMapping(value="role")
//@Api(tags = "角色管理")
@Tag(name="角色管理")
public class RoleController {
	
	//@ApiOperation("管理员添加角色")
	@Tag(name="用户管理")
	@Operation(summary = "管理员添加角色",
            description = "增加系统角色",
            parameters = {
                    @Parameter(name = "role", description = "角色"),
                    @Parameter(name = "user", description = "增加人")
            },
            responses = {
                    @ApiResponse(description = "返回添加的角色", content = @Content(mediaType = "application/json", schema = @Schema(anyOf = {SysRole.class}))),
                    @ApiResponse(responseCode = "400", description = "返回400时候错误的原因")
            }
    )
	@PostMapping("addRole")
	public ResponseMessage<String> addRole(SysRole role,XbUser user){
		return null;
	}
	
	@ApiOperation("删除角色")
	@ApiResponses({@ApiResponse(description="成功",responseCode="200",content=@Content(examples=@ExampleObject(value="{code:200,data:'',msg:''}")))})
	@PostMapping("delRole")
	public ResponseMessage<Object> delUser(String user,String ids) {
		System.out.println(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
		return null;
	}
}
